package com.ruoyi.socket.business;

import com.ruoyi.socket.gateway.NettyClientPool;
import com.ruoyi.socket.util.RedisPool;

/***
 *  @description 处理业务逻辑
 *  @author zhao
 *  @date: 2020/6/13
 *  @version: v1.0
 */

public class BusinessHandler {

    private static BusinessHandler myCustomerHandler;

    private RedisPool redisPool;
    private NettyClientPool nettyClientPool;


    // 初始化保证
    private BusinessHandler() {
        String host = "127.0.0.1";
        Integer port = 8081;
        nettyClientPool = NettyClientPool.getInstance(host, port);

    }


    public static synchronized BusinessHandler getInstance() {
        if (myCustomerHandler == null) {
            myCustomerHandler = new BusinessHandler();
        }
        return myCustomerHandler;
    }

    // 如上保证该类的单例


    //处理从网关接收的数据
    public String handlerDeviceGateWay(String gateWayDate) {
        System.out.println("处理从网关接收的数据" + gateWayDate);
        // todo
        String result = "done";

        System.out.println("处理从网关接收的数据" + result);
        return result;

    }

}
